package servlet;

import javax.servlet.*;
import java.io.IOException;

public class QuickStratServlet implements Servlet {
    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse)
            throws ServletException, IOException {
        System.out.println("service running...");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
//       1. 获得servlet的name  <servlet-name>heibaike</servlet-name>
        String servletName = servletConfig.getServletName();
        System.out.println(servletName);
//        2.获得servlet的初始化的参数
        String initParameter = servletConfig.getInitParameter("url");
        System.out.println(initParameter);
//        3.获得Servletcontext对象
        ServletContext servletContext = servletConfig.getServletContext();
        System.out.println("init running...");
    }

    @Override
    public void destroy() {
        System.out.println("destroy runing...");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public String getServletInfo() {
        return null;
    }
}
